﻿using System;
using System.Data.Entity;
using System.Linq;
using TelerikedIn.Models;
using Microsoft.AspNet.Identity.EntityFramework;

namespace TelerikedIn.Data
{
    public class DataContext : IdentityDbContextWithCustomUser<ApplicationUser>, IDataContext
    {
        public IDbSet<Skill> Skills { get; set; }

        public IDbSet<Endorsment> Endorsments { get; set; }

        public IDbSet<Connection> Connections { get; set; }
        
        //protected override void OnModelCreating(DbModelBuilder modelBuilder)
        //{
        //    modelBuilder.Entity<ApplicationUser>().HasMany(a => a.ApplicationUsers).WithMany(a => a.ApplicationUsers)
        //   .Map(m =>
        //   {
        //       m.ToTable("Connections"); // Relationship table name
        //       m.MapLeftKey("Connected"); // Name of column for student IDs
        //       m.MapRightKey("ConnectionTo"); // Name of column for course IDs
        //   });

        //    base.OnModelCreating(modelBuilder);
        //}

    }
}
